Repository navigation
Conversation
There was a problem hiding this comment.
AI review by Claude - workflow run
Patch is correct, with 0 blocking findings. The pinned cache holds a reference to each context that it maps, so an address-and-hint match can't alias a different tag. clear/finish resets the cache together with the tag dictionary. The comments below ask to document that invariant and to explain the two 32 thresholds.
There was a problem hiding this comment.
More details
Static review identified no actionable defect in symbol ownership, cache resets, or tagset encoding. Runtime behavior and the reported performance gains remain unverified.
🤖 Bits Code Review · Commit 8a614a8
Binary Size Analysis (Agent Data Plane)Baseline: 8c80abe · Comparison: dd7e5e5 · diff ✅ Binary size difference within thresholdChanges by Module
Detailed Symbol Changes |
Regression Detector (Agent Data Plane)Run ID: Optimization Goals: ✅ No significant changes detectedFine details of change detection per experiment (5)Experiments configured
Bounds Checks: ✅ Passed (5)
ExplanationA change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression ( |
8a614a8 to
4a68fbc
Compare
There was a problem hiding this comment.
More details
The retained-symbol cache preserves tag identity across symbol reuse, with text interning as the fallback. Execution validation was blocked by an unavailable workspace Git dependency.
🤖 Bits Code Review · Commit 4a68fbc
4a68fbc to
e916c70
Compare
There was a problem hiding this comment.
More details
Cache entries retain their symbol owners, and writer reset clears the cache alongside the tag dictionary, preserving the identity needed to reuse payload IDs safely.
🤖 Bits Code Review · Commit e916c70
e916c70 to
f2d9731
Compare
There was a problem hiding this comment.
More details
The static review found that retained symbol owners and writer resets preserve cache identity, while the tagset sorting fallback preserves duplicates. Runtime behavior and reported performance gains were not independently validated.
🤖 Bits Code Review · Commit f2d9731
f2d9731 to
ff02c03
Compare
There was a problem hiding this comment.
More details
Retained contexts preserve cached symbol identity, and the tagset fast path preserves sorting and duplicate handling. Unit-test execution was blocked by a required workspace dependency unavailable offline.
🤖 Bits Code Review · Commit ff02c03
ff02c03 to
6dd3477
Compare
There was a problem hiding this comment.
More details
Cached tag IDs retain immutable symbol owners and reset with payload dictionaries, preserving symbol identity and payload scope. The completed static review identified no reportable defects.
🤖 Bits Code Review · Commit 42e83cd
42e83cd to
7cb0085
Compare
There was a problem hiding this comment.
More details
Retained contexts preserve cached symbol identity, and the tagset encoding fast path preserves ordering and duplicate IDs. The static reviewer identified no actionable defects.
🤖 Bits Code Review · Commit 7cb0085
7cb0085 to
21be295
Compare
There was a problem hiding this comment.
More details
Retained symbol owners and cache resets preserve tag dictionary identity. The bitset fast path preserves sorted delta encoding and falls back to comparison sorting when duplicates occur.
🤖 Bits Code Review · Commit 21be295
21be295 to
ba3bf1b
Compare
There was a problem hiding this comment.
More details
Cache entries retain their backing contexts until replacement or writer reset, preventing symbol reuse from aliasing payload IDs. Resetting the writer also clears cached IDs before the next payload.
🤖 Bits Code Review · Commit ba3bf1b
ba3bf1b to
5035b92
Compare
There was a problem hiding this comment.
More details
Retained symbol ownership and payload resets preserve cache validity. The tagset fast path preserves encoding behavior, including duplicate IDs through the existing sorting path.
🤖 Bits Code Review · Commit 5035b92
5035b92 to
58ed8f5
Compare
There was a problem hiding this comment.
More details
The retained-symbol cache preserves backing-string ownership and resets cached IDs with the writer; the static reviewer reported no actionable defects. Unit tests were blocked by unavailable libdatadog dependency access.
🤖 Bits Code Review · Commit 58ed8f5
58ed8f5 to
439c398
Compare
There was a problem hiding this comment.
More details
Retained symbol owners protect cached tag IDs from recycled-symbol aliasing, and writer reset clears the mappings alongside the payload dictionaries. The completed static review raised no reportable findings.
🤖 Bits Code Review · Commit 439c398
439c398 to
7d53122
Compare
There was a problem hiding this comment.
More details
Retained context ownership protects cached tag symbols from address reuse, and the tagset sorting shortcut preserves duplicate handling. The completed static review produced no reportable findings.
🤖 Bits Code Review · Commit 7d53122
7d53122 to
4c7fd94
Compare
There was a problem hiding this comment.
More details
The static specialist raised no reportable concern with symbol ownership or tag-ID encoding. Runtime confirmation remains limited because an uncached libdatadog Git dependency blocked test execution.
🤖 Bits Code Review · Commit 4c7fd94
4c7fd94 to
3522cdc
Compare
There was a problem hiding this comment.
More details
Retained contexts protect cached tag identities from symbol reuse, and the sorting fast path preserves tagset encoding. The completed static review produced no actionable findings.
🤖 Bits Code Review · Commit 3522cdc
3522cdc to
dd7e5e5
Compare
There was a problem hiding this comment.
More details
The cache retains tag owners until replacement or writer reset, protecting cached identities from recycled symbol hints. Unit tests could not run because required Git dependencies were unavailable.
🤖 Bits Code Review · Commit dd7e5e5
Even with arena dictionaries, the V3 writer hashes every tag string to find its payload ID. On the 50-tag workload, each metric carries 50 tags, so the writer hashes 50 strings per metric on every flush. Packed contexts already hold a `SymbolTable` ID for each recurring tag. This change maps packed symbol IDs directly to V3 tag IDs through a small cache. The writer holds a reference on each mapped symbol, so a reclaimed ID cannot alias a different tag. Tags without a usable symbol still intern by text. Stripped `optimized-release` Tier 1 runs on 50-tag show cgroup CPU falling 6.32% and peak memory falling 6.9 MiB. - [ ] Bug fix - [ ] New feature - [ ] Non-functional - [x] Performance - `cargo check --locked --workspace --tests` - `cargo test --locked -p datadog-agent-metrics-v3 --lib pinned_tags_share_dictionary_ids_without_aliasing_recycled_symbol_hints` - Tier 1 runs use stripped `optimized-release` builds against base `18f587f5f6` in cgroup v2, in default unbounded mode. - 50-tag holds 1,000,000 gauges that each carry 50 tags drawn from a 100-tag shared pool. - Requires: the V3 arena writer, and packed `Context` symbol IDs. - Required by: none. - Release note: `releasenotes/notes/v3-packed-symbol-ids-53e4988c02026291.yaml` - Context & Tag Density: pack contexts into one allocation and drop unused cache overhead. - Dense Aggregation: replace 177 B buckets with per-kind typed pages. - Resumable Flush: shrink metric buffers and interleave bounded flush chunks. - Idle Pipeline Bypass: skip inactive transforms and borrow client telemetry. - **`300m` CPU:** cut encoder, codec and worker-pool hot-path cost. - PR TBD: reuse V3 dictionary arenas and frame payloads in one pass - **Current:** map packed tag symbols directly to V3 payload IDs - PR TBD: reuse the `zstd` context and gate per-column recompression - PR TBD: parse DogStatsD metrics in one pass and fast-path singleton scalars - PR TBD: classify and deduplicate metric tags on the stack - PR TBD: size the dedicated topology worker pool to available CPUs - Memory Admission: enforce opt-in configured memory limits with idle reclaim and counted drops.
dd7e5e5 to
737e4ac
Compare
There was a problem hiding this comment.
More details
Retained context ownership prevents recycled symbol IDs from aliasing cached tags. The static reviewer found no actionable defects in the cache or the tag sorting and delta-encoding path.
🤖 Bits Code Review · Commit 737e4ac
Summary
Even with arena dictionaries, the V3 writer hashes every tag string to find its payload ID. On the 50-tag workload, each metric carries 50 tags, so the writer hashes 50 strings per metric on every flush. Packed contexts already hold a
SymbolTableID for each recurring tag.This change maps packed symbol IDs directly to V3 tag IDs through a small cache. The writer holds a reference on each mapped symbol, so a reclaimed ID cannot alias a different tag. Tags without a usable symbol still intern by text.
Stripped
optimized-releaseTier 1 runs on 50-tag show cgroup CPU falling 6.32% and peak memory falling 6.9 MiB.Change Type
How did you test this PR?
cargo check --locked --workspace --testscargo test --locked -p datadog-agent-metrics-v3 --lib pinned_tags_share_dictionary_ids_without_aliasing_recycled_symbol_hintsoptimized-releasebuilds against base18f587f5f6in cgroup v2, in default unbounded mode.References
blt/1m-13-metrics-v3-arenas)Contextsymbol IDs.releasenotes/notes/v3-packed-symbol-ids-53e4988c02026291.yamlSeries overview
300mCPU: cut encoder, codec and worker-pool hot-path cost.